<template>
  <div>
    <van-nav-bar
    fixed
      :title="title"
    />
    <div class="main">
      <router-view></router-view>
    </div>
    <van-tabbar route v-model="active">
      <van-tabbar-item to="/layout/home" icon="home-o">标签</van-tabbar-item>
      <van-tabbar-item to="/layout/search" icon="search">标签</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  data() {
    return {
      active: 0,
      title:'',
    };
  },
  watch:{
    $route:{
      handler(newV){
        this.title = newV.meta.title
      },
      immediate:true
      
    }
  }
};
</script>

<style>
.main {
  padding-top: 46px;
  padding-bottom: 50px;
}
</style>